home *** CD-ROM | disk | FTP | other *** search
/ Freaks Macintosh Archive / Freaks Macintosh Archive.bin / Freaks Macintosh Archives / Phreaking⁄Wardialers / Term Applications / BlackNight1.0.4.sit / BlackNight1.0.4 / Black Night.rsrc / TEXT_7173_7.3 Returning a Result.txt < prev    next >
Text File  |  1995-11-22  |  816b  |  29 lines

  1. Returning a Result
  2.  
  3. Most scripts return a result which Black Night will display in a dialog box. The result in an AppleScript is always the result of the last function. Sometimes you won't be interested in this result and sometimes you will.
  4.  
  5. For example, the following script will return "true" or "false":
  6.  
  7. tell application "Black Night"
  8.     wait until connection of document 1 becomes active
  9. end tell
  10.  
  11. but the following script is a lot more informative:
  12.  
  13. tell application "Black Night"
  14.     wait until connection of document 1 becomes active
  15.       if result then
  16.           return "Yahoo, we're connected"
  17.       else
  18.           return  "Sorry, unable to connect"
  19.       end if
  20. end tell
  21.  
  22. and the following script returns nothing:
  23.  
  24. tell application "Black Night"
  25.     wait until connection of document 1 becomes active
  26.     return
  27. end tell
  28.  
  29.